﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UnityEngine;

class LongSpear : Weapon
{
    public LongSpear()
    {
        m_Price = 458;
        m_Type = ItemsType.WEAPON_MIDDLE_KINETICS_LONG_SPEAR;
        m_DamageType = DamageType.TYPE_KINETIC;
        m_Speciality = Speciality.MAIN;
        ResearchInfluence = InfluenceMG.INFLUENCE_EARTH;
        m_Level = Level.LEVEL_MIDDLE;
        ShutRange = 8f;
        ShutVelocity = 3.5f;
        BulletFlyVelocity = 9.8f;
        Damage = 180f;
        TurnSpeed = 60f;
        m_DropRate = 0.1f;
        m_ExplotionScale = 0.5f;
        Name = "长矛";
        Perview = "Textures/Weapon/WeaponMiddle/LongSpear";
        WeaponResource = "Perfabs/Weapon/Middle/LongSpear";
        BulletResource = "Perfabs/Bullet/ShortSpear";
        m_FireAudioResouce = "Perfabs/Audio/Pang";
        Description = "长矛是中型型武器中口径最大的动能武器，强力的穿透力就连护盾也没办法挡住。射程相对于同系列的短矛要长一些，但仍然是一块短板，虽然能够穿透护盾，但是对舰体的伤害太小。";
    }

    public override FlyItem Fire(GameObject ship, WeaponSlot slot, Vector3 position, Vector3 direction)
    {
        if (ship)
            m_Ship = ship.GetComponent<Ship>();
        Slot = slot;
        var item = base.Fire(ship, slot, position, direction);
        Bullet bullet = item as Bullet;
        if (bullet)
            bullet.m_Pierce = true;
        return item;
    }
}